package com.xyy.saas.payment.cores.vo;

import lombok.Data;

import java.io.Serializable;

@Data
public class TransactionResultItem implements Serializable {
    private String tradeNo;
    private String channel;
    private Integer amount;
    private String status;
    private Long successTime;
    private String businessOrderNo;

    public static TransactionResultItem build(String tradeNo, String status){
        return build(tradeNo,status,null, null, null,null);
    }

    public static TransactionResultItem build(String tradeNo, String status, Integer amount, String realChannel){
        return build(tradeNo,status,amount, realChannel, null,null);
    }

    public static TransactionResultItem build(String tradeNo, String status, Integer amount, String realChannel, Long successTime, String businessOrderNo){
        TransactionResultItem item = new TransactionResultItem();
        item.setTradeNo(tradeNo);
        item.setChannel(realChannel);
        item.setAmount(amount == null ? 0 : amount);
        item.setSuccessTime(successTime);
        item.setBusinessOrderNo(businessOrderNo);
        item.setStatus(status);
        return item;
    }
}
